package com.feng.cloud.common.configure;

import com.feng.cloud.common.customer.DefaultDelayCustomer;
import com.feng.cloud.common.producer.FengDelayProducer;
import org.apache.rocketmq.spring.autoconfigure.RocketMQAutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName EnhanceDelayMessageConfigure
 * @Description TODO
 * @Author Better Feng
 * @Date 2021/1/30 17:09
 **/
@Configuration(proxyBeanMethods = false)
@AutoConfigureAfter(RocketMQAutoConfiguration.class)
public class EnhanceDelayMessageConfigure {

    @Bean
    @ConditionalOnMissingBean(FengDelayProducer.class)
    public DefaultDelayCustomer defaultDelayCustomer() {
        return new DefaultDelayCustomer();
    }

    @Bean
    @ConditionalOnMissingBean(FengDelayProducer.class)
    public FengDelayProducer fengDelayProducer() {
        return new FengDelayProducer();
    }

}
